package cn.pli.bike.ui;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.framemodule.utils.CommonUtils;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import cn.pli.bike.R;
import cn.pli.bike.bean.CreditRecord;
import cn.pli.bike.bean.UserInfoSetBean;

/**
 * Created by shangdongzhou on 2017/11/19.
 */

public class CreditRecordAdapter extends BGARecyclerViewAdapter<CreditRecord> {

    public CreditRecordAdapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.item_credit_detail);
    }

    @Override
    protected void fillData(BGAViewHolderHelper helper, int position, CreditRecord model) {
        helper.getTextView(R.id.tv_item_describe).setText(model.getIntegralDepict());
        helper.getTextView(R.id.tv_item_date).setText(CommonUtils.parseDateTime(model.getAddTime()));
        String type = "";
        if ("1".equals(model.getIntegralType())) {
            type = "-";
        } else {
            type = "+";
        }
        helper.getTextView(R.id.tv_scroll_change).setText(mContext.getString(R.string.credit_score) + " " + type + " " + model.getIntegral());


    }
}
